import axios from 'axios';
//
// let base = 'http://localhost:55571';

let base = '';
let loginConnectUrl = "https://sec.wedengta.com";

// export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };
//
// export const getUserList = params => { return axios.get(`${base}/api/getUserList`, { params: params }); };
//
// export const delUser = para
export default {
    getSession: function (params) {
        return axios.get(`${loginConnectUrl}/conn/` + params.url, {
            timeout: 50000
        }).then(res => res.data).catch(e => e);
    },
    getMessage: function (params) {
        return axios.get(`${loginConnectUrl}/conn/` + params.url, {
            timeout: 50000
        }).then(res => res.data).catch(e => e);
    },
    getDataByID: function (params) {
        return axios.post(`${base}/api/getDataById`, params).then(res => res.data).catch(e => e);
    },
    getList: function (params) {
        return axios.post(`${base}/api/getList`, params).then(res => res.data).catch(e => e);
    },
    getOpreators: function (params) {
        return axios.post(`${base}/api/getOpreators`, params).then(res => res.data).catch(e => e);
    },
    delete: function (params) {
        return axios.post(`${base}/api/delete`, params).then(res => res.data).catch(e => e);
    },
    passNews: function (params) {
        return axios.post(`${base}/api/pass`, params).then(res => res.data).catch(e => e);
    },
    batchDelete: function (params) {
        return axios.post(`${base}/api/batchDelete`, params).then(res => res.data).catch(e => e);
    },
    batchPass: function(params) {
        return axios.post(`${base}/api/batchPass`, params).then(res => res.data).catch(e => e);
    },
    deleteByParams: function (params) {
        return axios.post(`${base}/api/deleteByParams`, params).then(res => res.data).catch(e => e);
    },
    requestLogin: function (params) {
        return axios.post(`${base}/api/checkLoginStatus`, params).then(res => res.data).catch(e => e);
    },
    getUrlRightList: function (params) {
        return axios.post(`${base}/api/getUrlRightList`, params).then(res => res.data).catch(e => e);
    },
    getRightConfig: function (params) {
        return axios.post(`${base}/api/getRightConfig`, params).then(res => res.data).catch(e => e);
    },
    saveRightConfig: function (params) {
        return axios.post(`${base}/api/saveRightConfig`, params).then(res => res.data).catch(e => e);
    },
    addOrEditSubmit: function (params) {
        return axios.post(`${base}/api/addOrEditOrDelete`, params).then(res => res.data).catch(e => e);
    },
    getAtomParameters: function (params) {
        return axios.post(`${base}/api/getAtomParameters`, params).then(res => res.data).catch(e => e);
    },
    batchAddAtomParameter: function (params) {
        return axios.post(`${base}/api/batchAddAtomParameter`, params).then(res => res.data).catch(e => e);
    },
    batchUpdateAtomParameter: function (params) {
        return axios.post(`${base}/api/batchUpdateAtomParameter`, params).then(res => res.data).catch(e => e);
    },
    getPreviewArticle: function (params) {
        return axios.post(`${base}/api/getPreviewArticle`, params).then(res => res.data).catch(e => e);
    },
    getSingleStockPreviewArticle: function(params) {
        return axios.post(`${base}/api/getSingleStockPreviewArticle`, params).then(res => res.data).catch(e => e);
    },
    getPreviewPhrase: function (params) {
        return axios.post(`${base}/api/getPreviewPhrase`, params).then(res => res.data).catch(e => e);
    },
    getPreviewParagraph: function (params) {
        return axios.post(`${base}/api/getPreviewParagraph`, params).then(res => res.data).catch(e => e);
    },
    publishSchedule: function (params) {
        return axios.post(`${base}/api/publishSchedule`, params).then(res => res.data).catch(e => e);
    },
    publish: function (params) {
        return axios.post(`${base}/api/publish`, params).then(res => res.data).catch(e => e);
    },
    compile: function(params) {
        return axios.post(`${base}/api/compile`, params).then(res => res.data).catch(e => e);
    }
}